<?php
/**
 * System_Model_TaskMapper
 *
 * @author maomao.thx@gmail.com
 * @copyright Copyright (c) 2009 Green Shore (http://www.iwgame.com)
 * @version $Id: TaskMapper.php 586 2011-05-31 10:07:18Z mmxie $
 */
class System_Model_TaskMapper extends IG_ModelMapper
{
    /**
     *
     * @param int $id
     * @param int $status
     * @param int $type
     */
    public function updateStatus($id, $status, $type = 1)
    {
        $where = array();
        if ($type == 1) {
            $where['task_id<=?'] = $id;
        } else if ($type == 2) {
                $where['task_id=?'] = $id;
        }
        if (!empty($where)) {
            $this->getDbTable()->update(array('status' => $status), $where);
        }
    }
}

